import { GET, POST, DELETE, PATCH } from '@/utils/request'

const ProductService = {
    loadProductList: (data?: any) => POST('/product/findAllByPage', data),
    loadProductListAll: (data?: any) => POST('/product/findAll', data),
    loadProductCategory: (data?: any) => GET('/product/category', data),
    addProduct: (data?: any) => POST('/product/add', data),
    deleteProduct: (id: string) => DELETE(`/product/delete/${id}`),
    updateProduct: (id: string, data: any) => PATCH(`/product/update/${id}`, data),
    getProductById: (data: any) => GET(`/product/findByPId`, data),
    saveStockRecord: (data?: any) => POST('/stock/add', data),
    updateStockRecord: (data?: any) => POST('/stock/update/guid', data),
    removeStockRecord: (guid?: string) => DELETE(`/stock/delete/${guid}`),
    loadHomeDeal: (data?: any) => GET('/stock/deal', data),
    loadHomeBar: (data?: any) => GET('/stock/home/bar/graph', data),
    loadHomeNightingale: (data?: any) => GET('/stock/home/nightingale', data),
    loadHomeLine: (data?: any) => GET('/stock/home/chart/line', data),
    loadRecordByPId: (data?: any) => POST('/stock/list/outAndPut', data),
    stockHomeProductPut: (data?: any) => GET('/stock/home/product/put', data),
    stockHomeProductOut: (data?: any) => GET('/stock/home/product/out', data),
    getAllProductStock: (data?: any) => GET('/product/all/stock', data),
}

export default ProductService